package com.liang.demo.base;

import com.liang.demo.context.WebContext;
import com.liang.demo.po.Admin;
import com.liang.demo.service.AdminService;
import com.liang.demo.util.ApplicationContextUtils;
import com.liang.demo.util.ModelMapperSingle;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @author 陈琪亮
 * @version 1.0
 * @date 2021/3/18 15:19
 */
public class BaseApiController {

    //默认分页大小
    protected final static String DEFAULT_PAGE_SIZE = "10";

    //转换对象（用来代替BeanUtils）
    protected final static ModelMapper modelMapper = ModelMapperSingle.Instance();

    @Autowired
    protected WebContext webContext;

    //获取当前登录对象
    protected Admin getCurrentUser() {
        return webContext.getCurrentUser();
    }
}
